import axios from "../utils/axios";

export default {
  getAll() {
    return axios.post("/api/order");
  },
  getOne(id) {
    return axios.get("/api/order/" + id);
  },
  create(goods, total, address) {
    return axios.post("/api/order", {
      data: {
        goods,
        total,
        address
      }
    });
  },
  pay(id, address) {
    return axios.post("/api/order/" + id, { data: address });
  },
  finish(id) {
    return axios.post("/api/order/" + id, { data: { status: 4 } });
  },
  drop(id) {
    return axios.delete("/api/order/" + id);
  }
};
